//
//  SimShot.cpp
//  Texture
//
//  Created by Yao Melo on 2/24/13.
//
//

#include "SimShot.h"

SimShot::SimShot(Vec3 position,bool isFromInvader)
{
    this->position = position;
    this->isFromInvader = isFromInvader;
}

void SimShot::Update(float delta)
{
    if(isFromInvader)
    {
        position.z+=SHOT_VELOCITY*delta;
    }
    else
    {
        position.z-=SHOT_VELOCITY*delta;
    }
    hasLeftField = (position.z > PlAYFEILD_Z_MAX || position.z < PlAYFEILD_Z_MIN);
    if(!isFromInvader)
    {
        printf("has left field:%s,current z:%f\n",hasLeftField?"true":"false",position.z);
    }
}

